package Day03;

import java.util.*;

public class Main {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        while(in.hasNext()){
            String s = in.next();
            sb.append(s.charAt(0));
        }
        String ans = sb.toString();
        System.out.println(ans.toUpperCase());
    }

    public static void main(String[] args) {
        //数据10^7
        //滑动窗口，需要快读
    }

    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        PriorityQueue<Integer> pq = new PriorityQueue<>((v1, v2) -> v2 - v1);
        int n = in.nextInt();
        int k = in.nextInt();
        long sum = 0;
        for(int i = 0; i < n; i++){
            long tmp = in.nextInt();
            sum += tmp;
            if(tmp % 2 == 0){
                pq.add((int)tmp);
            }
        }

        if(pq.isEmpty()){
            System.out.println(sum);
            return;
        }
        for(int i = 0; !pq.isEmpty() && i < k; i++){
            int tmp = pq.poll() / 2;
            sum -= tmp;
            if(tmp % 2 == 0){
                pq.add(tmp);
            }
        }
        System.out.println(sum);
    }
}
